package com.sushi.controller;

import com.sushi.service.LogService;
import com.sushi.response.ResponseBO;
import com.sushi.response.ResponsePageBO;
import com.sushi.response.LogResp;
import com.sushi.request.LogReq;
import com.sushi.request.LogPageReq;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.*;

/**
 * 日志 控制器
 * @date 2023-05-02
 * @time 17:14:41
 * @author Administrator
 */
@RestController
@Slf4j
public class LogController {

	@Autowired
	private LogService logService;

    

    /**
     * 新增
     */
    @PostMapping("/log/add")
    public ResponseBO<LogResp> add(@RequestBody LogReq req) {
        return logService.add(req);
    }

    /**
     * 逻辑删除
     */
    @PostMapping("/log/remove")
    public ResponseBO<LogResp> remove(@RequestBody LogReq req) {
        return logService.logicRemove(req);
    }

    /**
     * 更新
     */
    @PostMapping("/log/update")
    public ResponseBO<LogResp> update(@RequestBody LogReq req) {
        return logService.updateByField(req);
    }

    /**
     * 列表
     */
    @PostMapping("/log/list")
    public ResponsePageBO<LogResp> list(@RequestBody LogPageReq req) {
        return logService.listByCondition(req);
    }

    /**
     * 详情
     */
    @PostMapping("/log/detail")
    public ResponseBO<LogResp> detail(@RequestBody LogReq req) {
        return logService.detail(req);
    };

}